package com.xhc.demo.repository;

import com.xhc.demo.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {
    User findByOpenid(String openid);
    User findByToken(String token);
    // User findBySessionKey(String sessionKey);
    @Query("SELECT MAX(u.userId) FROM User u")
    Long findMaxUserId();
     
}
